package com.dpj.book.service.impl;

import com.dpj.book.mapper.UserMapper;
import com.dpj.book.pojo.User;
import com.dpj.book.service.UserService;
import com.dpj.book.utils.SqlSessionFactoryUtils1;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

public class UserServiceImpl implements UserService {
    SqlSessionFactory sessionFactory = SqlSessionFactoryUtils1.getSessionFactory();
    @Override
    public User selectByUser(User user) {
        SqlSession sqlSession = sessionFactory.openSession(true);
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User user1 = mapper.findUser(user);
        return user1;
    }
}
